package com.service.impl;

import com.bean.Detail;
import com.dao.DetailMapper;
import com.service.DetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DetailServiceImpl implements DetailService {
    @Autowired
    private DetailMapper detailMapper;

    @Override
    public int save(Detail detail) {
        return detailMapper.insert(detail);
    }

    @Override
    public int remove(Detail detail) {
        return detailMapper.delete(detail);
    }

    @Override
    public int modify(Detail detail) {
        return 0;
    }

    @Override
    public List<Detail> find(Detail detail) {
        return detailMapper.select(detail);
    }

    @Override
    public int count(Map<String, Object> map) {
        return 0;
    }

    @Override
    public List<Detail> query(Map<String, Object> map) {
        return null;
    }

    @Override
    public List<Detail> queryDetailByOrderId(int orderId) {
       return detailMapper.findByOrderId(orderId);
    }
}
